public class AboutArray {

    public static void func1(int[] array){
        array = new int[10];
    }
    public static void func2(int[] array) {
        array[0] = 99;
    }
    public static int[] func3(){
        int[] array = {1,2,3,4,5,6};
        return array;
        //可简写为
        //return new int[]{1,2,3,4,5,6};
    }

    public static void main(String[] args) {
        int[] array1 = {1,2,3,4};
        func1(array1);

        for (int i = 0;i < array1.length;i++) {
            System.out.println(array1[i] + "");
        }

        int[] array2 = {1,2,3,4};
        func2(array2);


        for (int i = 0;i < array2.length;i++) {
            System.out.println(array2[i] + "");
        }

        int[] ret = func3();
        for (int i = 0; i < ret.length;i++) {
            System.out.println(ret[i] + " ");
        }
    }
}

